package com.sijia.reggie.controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.sijia.reggie.comment.BaseContext;
import com.sijia.reggie.comment.R;
import com.sijia.reggie.entity.AddressBook;
import com.sijia.reggie.entity.OrderDetail;
import com.sijia.reggie.entity.Orders;
import com.sijia.reggie.entity.ShoppingCart;
import com.sijia.reggie.service.AddressBookService;
import com.sijia.reggie.service.OrderDetailService;
import com.sijia.reggie.service.OrderService;
import com.sijia.reggie.service.ShoppingCartService;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;

/**
 * @author 杨思佳
 * @version 1.0
 */
@RestController
@RequestMapping("/order")
public class OrderController {


    @Autowired
    private OrderService os;


    @Autowired
    private OrderDetailService ods;

    @Autowired
    private AddressBookService abs;

    @Autowired
    private ShoppingCartService scs;


    @PostMapping("submit")
    public R<String> submit(@RequestBody Orders orders){
        os.saveOrder(orders);
        return R.success("订单提交成功");
    }
}
